//
//  Point.cpp
//  Kmean
//
//  Created by Behrouz Derakhshan on 2/4/13.
//  Copyright (c) 2013 Behrouz. All rights reserved.
//

#include "Point.h"

Point::Point(){
}

Point::Point(std::vector<DATA_TYPE> point){
    this->point = point;
}

Point Point::operator=(Point point){
    this->point = point.point;
    return *this;
}

void Point::assign(Point point){
    this->point = point.point;
}

Point Point::operator+(Point point){
    Point result;
    for (int i = 0; i< point.size(); i++) {
        result.point.push_back(this->point[i] + point.point[i]);
    }
    return result;   
}
Point Point::operator+=(Point point){
    
    for(int i = 0 ; i < point.size() ; i++){
        this->point[i] += point[i];
    }
    return *this;
    
    
}
Point Point::operator-(Point point){
    Point result;
    for (int i = 0; i< point.size(); i++) {
        result.point.push_back(this->point[i] - point.point[i]);
    }
    return result;
}
Point Point::operator/(int denum){
    Point result;
    for (int i = 0; i< point.size(); i++) {
        result.point.push_back(this->point[i]/(double)denum);
    }
    return result;
}

unsigned long Point::size(){
    return point.size();
}

DATA_TYPE Point::operator[](const int index){
    return this->point[index];
}

std::vector<DATA_TYPE> Point::getPoint(){
    return point;
}

